home *** CD-ROM | disk | FTP | other *** search
- Path: news.primenet.com!not-for-mail
- From: gbe@primenet.com (Gary Edstrom)
- Newsgroups: comp.lang.c++
- Subject: Re: What is name-mangling? (mentioned in FAQ)
- Date: 22 Mar 1996 11:04:01 -0700
- Organization: Sequoia Software
- Sender: root@primenet.com
- Message-ID: <3152e97b.62546054@news.primenet.com>
- References: <4ik3s1$j7q@alcor.usc.edu>
- X-Posted-By: ip161.lax.primenet.com
- X-Newsreader: Forte Agent .99d/32.182
-
- Name-Mangling (also called decoration) is a method of encoding the number and
- types of parameters that a function takes into the name of the function. Thus,
- the function prototype "void xyz(int x)" might look something like "$xyz$qvr"
- if you examine the object file. This is required in C++ to produce type-safe
- linkage. In C++, you are allowed to have functions that have the same name,
- but differ only in the number or types of parameters that they take. This is
- something that is not allowed in normal C. The compiler needs to resolve these
- identical names into unique names for the linker. Thus, the need for mangled
- names. The problem is that name mangling is not defined as a standard.
- Therefore, every compiler could use a different scheme and thus be unable to
- link in libraries created by another compiler.
-
- I hope that helps,
-
- Gary
-
- wawda@alcor.usc.edu (Abu Wawda) wrote:
-
- >Hi. One of the questions in the FAQ mentioned "name-mangling". The
- >question was about compatibility between different vendor's libraires
- >with a common name-mangling scheme. But what is "name-mangling"?
- >Thanks in advance,
-
- --
- Gary Edstrom <gbe@primenet.com> | Sequoia Software
- PO Box 9573 | Programming & Technical Services
- Glendale CA 91226-0573 | PGP Key ID: 0x1A0D44BD
- PGP Fingerprint: 72 AA 4F 73 05 53 89 C6 8A EE F4 EE D1 C0 13 8D
-